<div id='sidebar'>
</div>

<div id='content'>
  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>所有分类</span>
      <% if (locals.own_page) { %>
      <span class='col_right'>
        <input type='button' id='add_list' class='btn' style='margin-left: 580px;' value='添加分类' />
      </span>
      <% } %>
    </div>
    <div class='inner'>
      <% if(locals.lists && lists.length > 0 ){ %>
      <table class='table'>
        <thead>
          <th>序号</th>
          <th>名字</th>
          <th>标签</th>
          <th>链接数</th>
          <th>followers</th>
          <th>操作</th>
        </thead>
        <tbody>
          <%- partial(locals.own_page ? 'list/list_can_edit' : 'list/list_can_follow', {collection:lists,as:'list'}) %>
        </tbody>
      </table>
      <% }else{ %>
      <p>无标签</p>
      <% } %>
    </div>
  </div>
  <div class='sep10'></div>
</div>


<% if(locals.current_user){ %>
<script type='text/javascript'>
  $(document).ready(function(){
    $('.delete_tag_btn').live('click', function(){
      if(confirm('确定要删除此分类吗？')) {
        window.location.href = $(this).attr('href');
      }
      return false;
    });

    $('#add_list').click(function() {
      $.get('/list/new', function(data) {
        $('#content').append(data);
      })
    })

    $('a.list_edit_rep').click(function(e) {
      e.preventDefault();
      $.get($(this).attr('href'), function(data) {
        $('#content').append(data);
      });
    });

    $('.panel .close').live('click', function() {
      $(this).parents('.panel').remove();
    });
  });
</script>
<% } %>
